package com.yilifang.controller;

import com.yilifang.config.result.Result;
import com.yilifang.config.result.ResultGenerator;
import com.yilifang.service.ZbdlApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by zhuan on 2018-09-19.
 */
@RestController
@RequestMapping("/daZbdlAnnounce")
public class ZbdlAnnounceController {

    @Autowired
    ZbdlApiService zbdlApiService;

    /**
     * 招标代理公告List
     * @param page
     * @param size
     * @return
     */
    @GetMapping("/zbdlAnnounceList")
    public Result zbdlAnnounce(@RequestParam(value = "page",defaultValue = "1") Integer page,
                               @RequestParam(value = "size",defaultValue = "5") Integer size,
                               @RequestParam("vannouncetype") String vannouncetype){

        return ResultGenerator.genSuccessResult(zbdlApiService.getZbdlAnnounceList(page,size,vannouncetype));
    }

    /**
     * 招标代理公告Html
     * @param id
     * @return
     */
        @GetMapping("/zbdlAnnounceHtml")
    public Result zbdlAnnounceHtml(@RequestParam(value = "id") String id){

        return ResultGenerator.genSuccessResult(zbdlApiService.getZbdlAnnounceHtml(id));
    }
}
